﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Excellent
{
    public partial class TheuserForm : Form
    {
        public TheuserForm()
        {
            InitializeComponent();
        }

        private void tsbSelect_Click(object sender, EventArgs e)
        {
            resultsForm re = new resultsForm();
            re.Show();
        }

        private void toolStripButton2_Click(object sender, EventArgs e)
        {
             string  ame= LoginType.UserName;
            string sql = string.Format("select Studentid,name,sex,phone,address,dateofbirth,email from  " +
                " StudentUsers where name='{0}'", ame);
            DataSet ds = DBHelper.GetDataSet(sql);
            DataTable dt = ds.Tables[0];
            if (dt.Rows.Count > 0)
            {
                this.dataGridView1.DataSource = dt;
            }
        }
    }
   }

